
#!/bin/sh
serverIP=${hostNames}
remoteCmdPath=$1
saltServer=$2

servers=`awk 'BEGIN{list="'${serverIP}'";split(list,ip_list,",");for(ip in ip_list){print ip_list[ip];}}'`
for server in ${servers[*]}
do
    ssh ${saltServer} "ansible "$server" -m shell -a "${remoteCmdPath}""
done
